
from flask import Flask

from flask_cors import CORS

from models import db
from views.book import book_bp


def create_flask_app(config):
    app = Flask(__name__)
    app.config.from_object(config)
    db.init_app(app)
    cors = CORS(app)

    # 注册蓝图
    app.register_blueprint(book_bp)

    return app
